<?php
namespace app\admin\controller;

use app\BaseController;
use mailer\lib\Mailer;
use think\facade\Config;


class SendMessage extends BaseController
{
    public static function sendMsg($toUser,$title,$content)
    {
        $mailer = Mailer::instance();
        $res = $mailer->from(Config::get('mailer.addr'),Config::get('mailer.name'))
            ->to($toUser)
            ->subject($title)
            ->text($content)
            ->send();
        return $res;
    }
}